package com.ag.improvedjava.iterable;

import java.util.Iterator;

public class ThrowingIterable<E> implements Iterable<E> {

	@Override
	public Iterator<E> iterator() {
		return new ThrowingIterator<>();
	}
}

class ThrowingIterator<E> extends UnmodifiableIterator<E> {

	@Override
	public boolean hasNext() {
		throw new UnsupportedOperationException();
	}

	@Override
	public E next() {
		throw new UnsupportedOperationException();
	}

}
